﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Business
{
    public class ChiTietDonDatKH
    {
        
        public int MaCTDDH { get; set; }
        public string MaCTDDHHienThi 
        {
            get
            {
                return "CTDDKH" + MaCTDDH;
            }
        }
        public int MaDDH { get; set; }        
        public int MaHang { get; set; }
        public string MaHangHienThi 
        {
            get 
            {
                return "HH" + MaHang;
            }
        }
        public string TenHang { get; set; }
        public int SoLuong { get; set; }
        public double GiaBan { get; set; }
        public DateTime NgayGiao { get; set; }
       

       
        public ChiTietDonDatKH(int maDDH, int maHang,
            string tenHang, int soLuong, double giaBan, DateTime ngayGiao)
        {
            this.MaCTDDH = 0;
            this.MaDDH = maDDH;
            this.MaHang = maHang;
            this.NgayGiao = ngayGiao;
            this.SoLuong = soLuong;
            this.GiaBan = giaBan;
            this.TenHang = tenHang;
        }

        public ChiTietDonDatKH(int maCTDDH,int maDDH, int maHang, 
            string tenHang, int soLuong, double giaBan,DateTime ngayGiao) 
        {
            this.MaDDH = maDDH;
            this.MaCTDDH = maCTDDH;
            this.MaHang = maHang;
            this.NgayGiao = ngayGiao;
            this.SoLuong = soLuong;
            this.GiaBan = giaBan;
            this.TenHang = tenHang;
        }

        public void CapNhat(int maHang,
            string tenHang, int soLuong, double giaBan, DateTime ngayGiao)
        {
            this.MaHang = maHang;
            this.NgayGiao = ngayGiao;
            this.SoLuong = soLuong;
            this.GiaBan = giaBan;
            this.TenHang = tenHang;
        }
       
    }
}
